package com.example.basecore.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author ycd0075
 * @date 2024-01-25 22:27
 */
@NoArgsConstructor
@Data
public class PageData <T> implements Serializable {
    /**
     * 当前那页数
     */
    private int pageNo;

    /**
     * 每页条数
     */
    private int pageSize;

    /**
     * 总页数
     */
    private long pageCount;

    /**
     * 数据总条数
     */
    private long totalCount;

    /**
     * 当前页数据内容
     */
    private List<T> dataList;


    public PageData(int pageNo, int pageSize, long pageCount, long totalCount, List<T> dataList) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.pageCount = pageCount;
        this.totalCount = totalCount;
        this.dataList = dataList;
    }

    public PageData(int pageNo, int pageSize, long pageCount, long totalCount) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.pageCount = pageCount;
        this.totalCount = totalCount;
    }

}
